<template>
  <view class="shop-list">
    <uni-list>
      <uni-list-item v-for="(item) in shopList" :key="item.shopName" :title="item.shopName" :show-arrow="true" @click="goShopInfo(item)"></uni-list-item>
    </uni-list>
  </view>
</template>

<script>
import { mapState, mapMutations } from "vuex";
export default {
  data() {
    return {};
  },
  computed: {
    ...mapState({
      shopList: state => state.user.shopList
    })
  },
  methods: {
    ...mapMutations({ SET_SHOP: "SET_SHOP" }),
    goShopInfo(item) {
      // console.log(item);
      this.SET_SHOP(item);
      this.$goto("shop");
    }
  }
};
</script>

<style lang="scss">
page {
  background-color: $uni-bg-color-grey;
}
</style>
